import request from '@/utils/request'

// 生成订单
export const saveOrder = (data: any) => {
  return request({
    url: '/order/saveOrder',
    type: 'post',
    data,
    qs: true
  })
}

// 下单支付
export const payOrder = (data: any) => {
  return request({
    url: '/pay/orderPlay',
    type: 'post',
    data,
    qs: true
  })
}

// 订单列表
export const orderList = (data: any) => {
  return request({
    url: '/order/list',
    type: 'get',
    data
  })
}
// 订单详情
export const orderInfo = (data: any) => {
  return request({
    url: '/order/details',
    type: 'get',
    data
  })
}
// 取消订单
export const orderCancel = (data: any) => {
  return request({
    url: '/order/cancelOrder',
    type: 'post',
    data
  })
}
// 申请退跨
export const orderRefund = (data: any) => {
  return request({
    url: '/order/applyRefund',
    type: 'post',
    data
  })
}

// 确认收货
export const orderReceive = (data: any) => {
  return request({
    url: '/order/receiveProduct',
    type: 'post',
    data
  })
}
